mir: always emit a resize when creating windows
authorWilliam Hua <william.hua@canonical.com>
Tue, 21 Mar 2017 15:25:36 +0000 (11:25 -0400)
committerWilliam Hua <william.hua@canonical.com>
Wed, 22 Mar 2017 06:44:38 +0000 (02:44 -0400)
gdk/mir/gdkmirwindowimpl.c

index f0a76872d2783ce1a5e8266df716fe0b22e22df7..9f9107611ebaf359f59506c5a1e8615fe93bff45 100644 (file)
@@ -580,6 +580,25 @@ generate_configure_event (GdkWindow *window,
   send_event (window, get_pointer (window), event);
 }
 
+static void
+synthesize_resize (GdkWindow *window)
+{
+  GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
+  MirWindowParameters params;
+
+  if (!impl->mir_window)
+    return;
+
+  mir_window_get_parameters (impl->mir_window, &params);
+
+  window->width = params.width;
+  window->height = params.height;
+
+  _gdk_window_update_size (window);
+
+  generate_configure_event (window, window->width, window->height);
+}
+
 static void
 maybe_synthesize_resize (GdkWindow *window)
 {
@@ -635,7 +654,7 @@ ensure_mir_window_full (GdkWindow      *window,
   impl->pending_spec_update = FALSE;
   impl->buffer_stream = mir_window_get_buffer_stream (impl->mir_window);
 
-  maybe_synthesize_resize (window);
+  synthesize_resize (window);
 
   /* FIXME: Ignore some events until shown */
   mir_window_set_event_handler (impl->mir_window, event_cb, window_ref);